package com.nulldev.util.concurrency.threadIt.v4.emapi.extensions;

public interface IFutureTaskFlags {

	public static final int FT_NOT_SUPPORTED = -1;
	public static final int FT_FALSE = 0;
	public static final int FT_TRUE = 1;

	/* Core Flags (FT 1.2/1.3) */

	public static final int FT_PREFER_BATCHING = 2;

	public static final int FT_LOW_PRIORITY = 4;
	public static final int FT_HIGH_PRIORITY = 8;
	public static final int FT_BACKGROUND_TASK = 16;
	public static final int FT_CONTINIOUS_TASK = 32;

	public static final int FT_PREFER_LOW_LATENCY = 64;
	public static final int FT_SUPPORTS_TRACES = 128;
	public static final int FT_SUPPORTS_POLLING = 256;

	/* 17..19 */

	public static final int FT_ATTEMPTABLE_TASK = 512;
	public static final int FT_HAS_SYNCHRONOUS_DEPENDENCY = 1024;

	/* Polling Flags (FT 1.1) */

	public static final int FT_POLLING_IMMEDIATE = 2048;
	public static final int FT_POLLING_LEGACY_SCALING = 4096;
	public static final int FT_POLLING_NEW_SCALING = 8192;

	public static final int FT_POLLING_METHOD_DEFAULT = FT_POLLING_LEGACY_SCALING;

	public static final long FT_POLLING_LEGACY_SCALING_WAITING_INTERVAL = 35L;

	/* Misc. */

	/**
	 * Queries the task for specific flags or states. (i.e. low-priority)
	 * 
	 * @param flag
	 * @returns Either: Object, int, boolean, or FT_NOT_SUPPORTED.
	 */
	public default Object getFlag(final int flag) {
		return FT_NOT_SUPPORTED;
	}

	public default int getFlags() {
		return FT_NOT_SUPPORTED;
	}
}
